import 'package:flutter/material.dart';

/// 高度为1的渐变线、分割线
class CustomGradientLine extends StatelessWidget {
  const CustomGradientLine({super.key, this.width});

  final double? width;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width ?? 247,
      height: 1,
      decoration: const BoxDecoration(
        gradient: LinearGradient(
          begin: Alignment.centerLeft,
          end: Alignment.centerRight,
          colors: [
            Color(0x00649FFF),
            Color(0xFF649FFF),
            Color(0x00649FFF),
          ],
        ),
      ),
    );
  }
}

class CustomGradientLine2 extends StatelessWidget {
  const CustomGradientLine2({super.key, this.width, this.height});

  final double? width;
  final double? height;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      height: height ?? 1,
      decoration: const BoxDecoration(
        gradient: LinearGradient(
          begin: Alignment.centerLeft,
          end: Alignment.centerRight,
          colors: [
            Color.fromARGB(0, 255, 255, 255),
            Color(0xFF649FFF),
          ],
        ),
      ),
    );
  }
}

class CustomVerticalGradientLine extends StatelessWidget {
  const CustomVerticalGradientLine({this.width = 1, this.height = 120, super.key});

  final double width;
  final double height;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      height: height,
      decoration: const BoxDecoration(
        gradient: LinearGradient(
          begin: Alignment.topCenter,
          end: Alignment.bottomCenter,
          colors: [
            Color(0x00649FFF),
            Color(0xFF649FFF),
            Color(0x00649FFF),
          ],
        ),
      ),
    );
  }
}
